package com.itlong.cloud.service;

import com.itlong.cloud.POJO.DTO.operate.DeadQueueGetPageDTO;
import com.itlong.cloud.POJO.PO.TimeTaskDeadMessageQueuePO;
import com.itlong.cloud.utils.page.Page;


/**
 * <desc>
 *      死信队列表业务逻辑处理接口。
 * </desc>
 *
 * @createDate 2017/11/16
 */
public interface ITimeTaskDeadMessageQueueService {

    /**
     * <desc>
     *      保存
     * <desc/>
     *
     * @param timeTaskDeadMessageQueuePO message消息
     * @return 影响结果
     * @author Wernchao.L
     * @createDate 2017/11/16
     */
    Integer save(TimeTaskDeadMessageQueuePO timeTaskDeadMessageQueuePO) throws Exception;

    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO 查询参数DTO
     * @return page模型
     * @author Jiaqi.X
     * @createDate 2017/09/25
     */
    Page<TimeTaskDeadMessageQueuePO> getPage(DeadQueueGetPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      发送死信
     * </desc>
     *
     * @param po
     * @author Jiaqi.X
     * @createDate 2017/11/29
     */
    public void sendMessage(TimeTaskDeadMessageQueuePO po,boolean  needRetrive) throws Exception;

    /**
     * <desc>
     *     定时任务检测错误的死信消息进行重发
     * </desc>
     *
     * @author Jiaqi.X
     * @createDate 2018/01/27
     */
    public void autoRedirectSendDeadMessage() throws Exception;
}
